home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / ole2book.zip / CHAP10.ZIP / CHAP10 / SCHMOO / CLIENT.CPP < prev    next >
C/C++ Source or Header  |  1993-06-13  |  2KB  |  97 lines

  1. /*
  2.  * CLIENT.CPP
  3.  *
  4.  * Implementation of the CSchmooClient class that just makes sure
  5.  * we get a CSchmooDoc on doc creation and that we initialize fully.
  6.  *
  7.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  8.  *
  9.  * Kraig Brockschmidt, Software Design Engineer
  10.  * Microsoft Systems Developer Relations
  11.  *
  12.  * Internet  :  kraigb@microsoft.com
  13.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  14.  */
  15.  
  16.  
  17.  
  18. #include "schmoo.h"
  19.  
  20.  
  21. /*
  22.  * CSchmooClient::CSchmooClient
  23.  * CSchmooClient::~CSchmooClient
  24.  *
  25.  * Constructor Parameters:
  26.  *  hInst           HINSTANCE of the application.
  27.  */
  28.  
  29. CSchmooClient::CSchmooClient(HINSTANCE hInst)
  30.     : CClient(hInst)
  31.     {
  32.     return;
  33.     }
  34.  
  35.  
  36. CSchmooClient::~CSchmooClient(void)
  37.     {
  38.     return;
  39.     }
  40.  
  41.  
  42.  
  43.  
  44.  
  45. /*
  46.  * CSchmooClient::CreateCDocument
  47.  *
  48.  * Purpose:
  49.  *  Constructs a new document specific to the application.
  50.  *
  51.  * Parameters:
  52.  *  None
  53.  *
  54.  * Return Value:
  55.  *  LPCDocument     Pointer to the new document object.
  56.  */
  57.  
  58. LPCDocument CSchmooClient::CreateCDocument(void)
  59.     {
  60.     return (LPCDocument)(new CSchmooDoc(m_hInst));
  61.     }
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. /*
  70.  * CSchmooClient::NewDocument
  71.  *
  72.  * Purpose:
  73.  *  Small override of the CClient::NewDocument that we have just to
  74.  *  check the initial line selection on new document creation.
  75.  *
  76.  * Parameters:
  77.  *  fVisible        BOOL indicating if the document is to be visible or not.
  78.  *  pAdv            LPCDocumentAdviseSink to set with the new document for
  79.  *                  notifications.  Can be NULL.
  80.  *
  81.  * Return Value:
  82.  *  LPCDocument      Pointer to the new document object.
  83.  */
  84.  
  85. LPCDocument CSchmooClient::NewDocument(BOOL fVisible, LPCDocumentAdviseSink pAdv)
  86.     {
  87.     LPCDocument pDoc;
  88.  
  89.     //Perform default NewDocument first
  90.     pDoc=CClient::NewDocument(fVisible, pAdv);
  91.  
  92.     //We know that m_pFR is actually a CSchmooFrame, so the type is safe.
  93.     ((LPCSchmooFrame)m_pFR)->CheckLineSelection(IDM_LINESOLID);
  94.  
  95.     return pDoc;
  96.     }
  97.